# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-html2text
_pyname=html2text
pkgver=2024.2.26
pkgrel=1
pkgdesc="Convert HTML to Markdown-formatted text"
url="https://github.com/Alir3z4/html2text"
arch="noarch"
license="GPL-3.0-only"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-doc $pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/Alir3z4/html2text/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages testenv
	testenv/bin/python3 -m installer dist/*.whl
	testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
	install -Dm644 docs/* -t "$pkgdir/usr/share/doc/$_pyname"
}
sha512sums="
cce3018f3ba865afa8d62d5c393d98b43fab79615d15e5f2be813f5e41fefa377f7d27a902691876fcad4145a223c7d49f9a7a338d6fa8c22183900cbfe7e520  html2text-2024.2.26.tar.gz
"
